import type { UploadUserFile } from "element-plus";
// 请求参数类型
export interface SpuArguments {
  page: number;
  limit: number;
  category3Id: number;
}
// SPU 分页列表
export interface SpuPage {
  records: SpuPageList;
  total: number;
}
export type SpuPageList = SpuPageItem[];
export interface SpuPageItem {
  id: number;
  spuName: string;
  description: string;
  category3Id: number;
  tmId: number;
}
// 定义添加属性中的下拉框基本销售属性的数据类型
export type spuBaseAttrList = spuBaseAttrItem[];
export interface spuBaseAttrItem {
  id: number;
  name: string;
}
// 表单数据类型
export interface spuType {
  category3Id?: number;
  id?: number;
  spuName: string;
  tmId?: number;
  description: string;
  spuImageList: UploadUserFile[];
  spuSaleAttrList: spuSaleAttrList;
}
export type spuSaleAttrList = spuSaleAttrItem[];
export interface spuSaleAttrItem {
  baseSaleAttrId: number;
  id?: number;
  isShow?: boolean;
  saleAttrName: string;
  spuId?: number;
  spuSaleAttrValueList: spuSaleAttrValueList;
}
export type spuSaleAttrValueList = spuSaleAttrValueItem[];
export interface spuSaleAttrValueItem {
  baseSaleAttrId: number;
  saleAttrValueName: string;
  id?: number;
  isChecked?: string;
  saleAttrName?: string;
  spuId?: number;
}
// 给pinia保存的数据用
export interface spuPinia {
  id?: number;
  spuName: string;
  tmId?: number;
  description: string;
}

// 请求接口用
export interface addSpuType {
  category3Id?: number;
  id?: number;
  spuName: string;
  tmId?: number;
  description: string;
  spuImageList: spuImageList;
  spuSaleAttrList: spuSaleAttrList;
}
export type spuImageList = spuImageItem[];
export interface spuImageItem {
  id?: number;
  imgName: string;
  imgUrl: string;
  spuId?: number;
  isDefault?: "0" | "1";
}

